<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>koa2-blog</title>
	<link rel="icon" href="http://www.wclimb.site/images/avatar.png">
	<link rel="stylesheet" href="/index.css">
	<script src="http://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script>
		function fade(txt){
			$('.message').text(txt)
			$('.message').animate({
				top:0
			})
			setTimeout(function(){
				$('.message').animate({
					top: '-100%'
				})
			},1500)
		}
		$(function(){
			$('.signout').click(()=>{
				$.ajax({
					url: "/signout",
					type: "GET",
					cache: false,
					dataType: 'json',
					success: function (msg) {
						if (msg) {
							fade('登出成功')
							setTimeout(()=>{
								window.location.href = "/posts"
							},1500)	
						}
					},
					error: function () {
						alert('异常');
					}
				})
			})
		})
	</script>
</head>
<body>
	<header>
		欢迎使用^_^
	</header>